<template>
    <div>
        <ul>
            <!-- <router-link v-for="item in list" :key="item.id"
                tag="li"
                :to="{path:`/detail/${item.id}`}"
            >{{item.title}}</router-link> -->
            <li v-for="item in list" :key="item.id" @click="$router.replace({name:'detail',params:{id:item.id}})">{{item.title}}</li>
        </ul>
    </div>
</template>
<script>
export default {
    data(){
        return {
            list:[
                {
                    id:1,
                    title:'标题一'
                },
                {
                    id:2,
                    title:'标题二'
                },
                {
                    id:3,
                    title:'标题三'
                }
            ]
        }
    }
}
</script>
